/**
 * @author Mirko Bordjoski
 */	
package org.piwik.requests
{
	//import org.piwik.methods.ReferersMethods;
	
	/**
	* The Referers methods are used to get the referers informations from piwik analitycs. 
	*/	
	public class Referers
	{
		/**
		 * @private 
	 	*/
		public static const GET_KEYWORDS:String = "Referers.getKeywords";
		
		/**
		 * @private 
	 	*/
		public static const GET_SEARCH_ENGINES:String = "Referers.getSearchEngines";
		
		/**
		 * @private 
	 	*/
		public static const GET_REFERER_TYPE:String = "Referers.getRefererType";
		
		/**
		 * @private 
	 	*/
		public static const GET_WEBSITES:String = "Referers.getWebsites";
		
		
		
		
		/**
		 * Constructor.
	 	*/
		public function Referers(){}
		
		
		
		/**
		* Returns summary information about referer type.
		* <p />
		* 
		* @param	$date			[optional] You can use shortcut like 'last30' or just pass date in format YYYY-MM-DD. Default is 'yesterday'.
		* @param	$period			[optional] Can be 'day', 'week', 'month' or 'year'.
		* @param	$filterLimit	[optional] Limit the number of rows.
		*/
		public static function getRefererType($date:String = "yesterday", $period:String = "day", $filterLimit:uint = 100):PiwikRequest
		{			
			var req:PiwikRequest = new PiwikRequest();
			req.date = $date;
			req.filter = $filterLimit;
			req.moduleMethod = Referers.GET_REFERER_TYPE;//ReferersMethods.GET_REFERER_TYPE;
			req.period = $period;
			req.requestType = "getRefererType";
			
			return req;				
		}
		
		/**
		* Returns information about keywords.
		* <p />
		* 
		* @param	$date			[optional] You can use shortcut like 'last30' or just pass date in format YYYY-MM-DD. Default is 'yesterday'.
		* @param	$period			[optional] Can be 'day', 'week', 'month' or 'year'.
		* @param	$filterLimit	[optional] Limit the number of rows.
		*/
		public static function getKeywords($date:String = "yesterday", $period:String = "day", $filterLimit:uint = 100):PiwikRequest
		{			
			var req:PiwikRequest = new PiwikRequest();
			req.date = $date;
			req.filter = $filterLimit;
			req.moduleMethod = Referers.GET_KEYWORDS;//ReferersMethods.GET_KEYWORDS;
			req.period = $period;
			req.requestType = "getKeywords";
			
			return req;				
		}
		
		/**
		* Returns information about search engines.
		* <p />
		* 
		* @param	$date			[optional] You can use shortcut like 'last30' or just pass date in format YYYY-MM-DD. Default is 'yesterday'.
		* @param	$period			[optional] Can be 'day', 'week', 'month' or 'year'.
		* @param	$filterLimit	[optional] Limit the number of rows.
		*/
		public static function getSearchEngines($date:String = "yesterday", $period:String = "day", $filterLimit:uint = 100):PiwikRequest
		{			
			var req:PiwikRequest = new PiwikRequest();
			req.date = $date;
			req.filter = $filterLimit;
			req.moduleMethod = Referers.GET_SEARCH_ENGINES; //ReferersMethods.GET_SEARCH_ENGINES;
			req.period = $period;
			req.requestType = "getSearchEngines";
			
			return req;				
		}
		
		/**
		* Returns information about refering websites.
		* <p />
		* 
		* @param	$date			[optional] You can use shortcut like 'last30' or just pass date in format YYYY-MM-DD. Default is 'yesterday'.
		* @param	$period			[optional] Can be 'day', 'week', 'month' or 'year'.
		* @param	$filterLimit	[optional] Limit the number of rows.
		*/
		public static function getWebsites($date:String = "yesterday", $period:String = "day", $filterLimit:uint = 100):PiwikRequest
		{			
			var req:PiwikRequest = new PiwikRequest();
			req.date = $date;
			req.filter = $filterLimit;
			req.moduleMethod = Referers.GET_WEBSITES; //ReferersMethods.GET_WEBSITES;
			req.period = $period;
			req.requestType = "getWebsites";
			
			return req;				
		}

	}
}